package com.yc.navy.snacknet.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.navy.snacknet.bean.MemberInfo;
import com.yc.navy.snacknet.mapper.IMemberInfoMapper;
import com.yc.navy.snacknet.service.IMemberInfoService;
import com.yc.navy.snacknet.util.StringUtil;

@Service
public class MemberinfoServiceImpl implements IMemberInfoService{
	
	@Autowired
	private IMemberInfoMapper memberInfoMapper;

	@Override
	public MemberInfo login(MemberInfo map) {
		if(StringUtil.checkNull(map.getNickName(), map.getPwd())) {
			return null;
		}
		return memberInfoMapper.login(map);
	}

	@Override
	public int reg(MemberInfo mf) {
		if(StringUtil.checkNull(mf.getEmail(), mf.getNickName(), mf.getPwd())) {
			return -1;
		}
		return memberInfoMapper.reg(mf);
	}

	@Override
	public int updatePhono(Map<String, Object> map) {
		if(StringUtil.checkNull(map.get("mno"), map.get("photo"))) {
			return -1;
		}
		return memberInfoMapper.updatePhono(map);
	}

	
}
